!function(t,e,i){function d(e,i){selected=0,selected_visibility=0,selected_settings=0,in_customizer=!1,"undefined"!=typeof wp&&(in_customizer="undefined"!=typeof wp.customize),""!=e&&(t("#"+e.attr("id")).find("#extended-widget-opts-selectedtab").length>0&&(selected=t("#"+e.attr("id")).find("#extended-widget-opts-selectedtab").val(),selected=parseInt(selected)),t("#"+e.attr("id")).find("#extended-widget-opts-visibility-selectedtab").length>0&&(selected_visibility=t("#"+e.attr("id")).find("#extended-widget-opts-visibility-selectedtab").val(),selected_visibility=parseInt(selected_visibility)),t("#"+e.attr("id")).find("#extended-widget-opts-visibility-selectedtab").length>0&&(selected_settings=t("#"+e.attr("id")).find("#extended-widget-opts-settings-selectedtab").val(),selected_settings=parseInt(selected_settings))),"added"==i&&(selected=0,selected_visibility=0,selected_settings=0),""!=e?(t("#"+e.attr("id")).find(".extended-widget-opts-tabs").length>0&&t("#"+e.attr("id")).find(".extended-widget-opts-tabs").tabs({active:selected}),t("#"+e.attr("id")).find(".extended-widget-opts-visibility-tabs").length>0&&t("#"+e.attr("id")).find(".extended-widget-opts-visibility-tabs").tabs({active:selected_visibility}),t("#"+e.attr("id")).find(".extended-widget-opts-settings-tabs").length>0&&t("#"+e.attr("id")).find(".extended-widget-opts-settings-tabs").tabs({active:selected_settings})):(t(".extended-widget-opts-tabs").tabs({active:selected}),t(".extended-widget-opts-visibility-tabs").tabs({active:selected_visibility}),t(".extended-widget-opts-settings-tabs").tabs({active:selected_settings})),t(".extended-widget-opts-tabs").click("tabsselect",function(){t(this).find("#extended-widget-opts-selectedtab").length>0&&t(this).find("#extended-widget-opts-selectedtab").val(t(this).tabs("option","active"))}),t(".extended-widget-opts-visibility-tabs").click("tabsselect",function(){t(this).find("#extended-widget-opts-visibility-selectedtab").length>0&&t(this).find("#extended-widget-opts-visibility-selectedtab").val(t(this).tabs("option","active"))}),t(".extended-widget-opts-settings-tabs").click("tabsselect",function(){t(this).find("#extended-widget-opts-settings-selectedtab").length>0&&t(this).find("#extended-widget-opts-settings-selectedtab").val(t(this).tabs("option","active"))})}t(".extended-widget-opts-tabs").length>0&&d("","loaded"),t(i).ready(function(){t(".widget-liquid-right .widget, .inactive-sidebar .widget, #accordion-panel-widgets .customize-control-widget_form").each(function(){d("","loaded")}),t(i).on("widget-added",function(t,e){d(e,"added")}),t(i).on("widget-updated",function(t,e){d(e,"updated")}),t(i).on("click",".extended-widget-opts-inner-lists h4",function(){getid=t(this).attr("id"),t(".extended-widget-opts-inner-lists ."+getid).slideToggle(250)}),t(i).on("click",".widget-opts-toggler-note",function(e){t(this).parent("p").parent(".widget-opts-logic").find(".widget-opts-toggle-note").slideToggle(250),e.preventDefault(),e.stopPropagation()}),t(i).on("click",".opts-add-class-btn",function(e){getVal=t(".opts-add-class-txtfld").val();var i="extwopts_class_settings[classlists][]";t(this).hasClass("widgetopts-add-class-btn")&&(i="classes[classlists][]"),getVal.length>0&&(t("#opts-predefined-classes ul").append('<li><input type="hidden" name="'+i+'" value="'+getVal+'" /><span class"opts-li-value">'+getVal+'</span> <a href="#" class="opts-remove-class-btn"><span class="dashicons dashicons-dismiss"></span></a></li>'),t(".opts-add-class-txtfld").val("")),e.preventDefault(),e.stopPropagation()}),t(i).on("click",".opts-remove-class-btn",function(e){t(this).parent("li").fadeOut("fast",function(){t(this).remove()}),e.preventDefault(),e.stopPropagation()}),t(".wp-admin.widgets-php .wrap a.page-title-action").length>0&&t(".wp-admin.widgets-php .wrap a.page-title-action").after('<a href="'+widgetopts10n.opts_page+'" class="page-title-action hide-if-no-customize widgetopts-super">'+widgetopts10n.translation.manage_settings+"</a>"),"undefined"!=typeof t.fn.liveFilter&&t("#widgetopts-widgets-search").length>0&&(t(".widget:last-of-type").after('<div class="widgetopts-separator" />'),t("#widgets-left .widget").each(function(){var e=t(this).index()+1;t(this).attr("data-widget-index",e)}),t("#widgets-left").liveFilter("#widgetopts-widgets-search",".widget",{filterChildSelector:".widget-title h4, .widget-title h3",after:function(e,i){i.each(function(){t(this).insertAfter(t(this).parent().find(".widgetopts-separator"))}),e.sort(function(t,e){return t.getAttribute("data-widget-index")-e.getAttribute("data-widget-index")}),e.each(function(){t(this).insertBefore(t(this).parent().find(".widgetopts-separator"))})}}),t("#wpbody-content").on("keyup",".widgetopts-widgets-search",function(){p=t(this).parent().find(".widgetopts-clear-results"),""!==t(this).val()?p.addClass("widgetopts-is-visible"):p.removeClass("widgetopts-is-visible")}),t("#wpbody-content").on("click",".widgetopts-clear-results",function(e){return s=t(this).parent().find(".widgetopts-widgets-search"),s.val("").focus().trigger("keyup"),"widgetopts-search-chooser"==s.attr("id")&&t(".widgets-chooser-sidebars li:not(:first)").removeClass("widgets-chooser-selected"),e.preventDefault(),e.stopPropagation(),!1}),t(".widgets-chooser").prepend(widgetopts10n.search_form),t(".widgets-chooser").liveFilter("#widgetopts-search-chooser",".widgets-chooser-sidebars li",{after:function(e,i){i.each(function(){t(this).addClass("widgetopts-is-hidden").removeClass("widgets-chooser-selected")}),e.each(function(){t(this).removeClass("widgetopts-is-hidden").removeClass("widgets-chooser-selected")}),e.length>0&&t(e[0]).addClass("widgets-chooser-selected")}}))})}(jQuery,window,document);